// components/chapter/index.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        unitList:Object,
        chapterId:Object,
        chapterName:String,
        isShow:false
    },

    /**
     * 组件的初始数据
     */
    data: {

    },

    /**
     * 组件的方法列表
     */
    methods: {
        showUnit(event) {
            const isShow=this.data.isShow;
            this.setData({
                isShow:!isShow
            });
        },
        unitQuestion(event){
            let unitId=event.currentTarget.dataset.id;
            wx.navigateTo({
                url: `/pages/question/index?sourceType=0&typeId=${unitId}`
              });
        }
    }
})